import request from "@/utils/requestu.js"
import {pwd} from "@/config/config"
import Cache from '@/utils/cache';
import { LOGIN_STATUS_USER } from '@/config/store';
const token = Cache.get(LOGIN_STATUS_USER)
/**
 * 会员注册 登录接口
*/ 
export function userLogin(param){
	let params={
		pwd:pwd,
		qun_id:param.qunid,
		code:param.code
	}
  return request.post('userwxw/user_add_json',params,{noAuth:true});
}

/**
 * 判断用户是否能看这个视频 判断视频状态 是否能看 观看视频前 先调用此接口
*/ 
export function userVideoYN(id){
	let params={
		pwd:pwd,
		token:token,
		id:id
	}
  return request.post('yx/vode_user_yesno',params);
}

/**
 * 根据视频ID查询答题
*/ 
export function getVideoQuestion(id){
	let params={
		pwd:pwd,
		id:id
	}
  return request.post('yx/void_question',params);
}

/**
 * 根据视频id 查询详情
*/ 
export function getVideoInfo(id){
	let params={
		pwd:pwd,
		id:id
	}
  return request.post('yx/hdvideo_one',params);
}

/**
 * 判断答题是否正确
*/ 
export function testQuestion(param){
	let params={
		pwd:pwd,
		token:token,
		...param
	}
  return request.post('yx/question_yesno',params);
}

/**
 * 中途发红包
*/ 
export function getVideoHB(id){
	let params={
		pwd:pwd,
		token:token,
		id:id
	}
  return request.post('yx/vo_pic_zt',params);
}

/**
 * 看完结束的抽奖红包
*/ 
export function getVideoHBOver(id){
	let params={
		pwd:pwd,
		token:token,
		id:id
	}
  return request.post('yx/vo_pic_js_cj',params);
}

/**
 * 抽奖列表
*/ 
export function getCJList(id){
	let params={
		pwd:pwd,
	}
  return request.post('yx/lott_index',params);
}

/**
 * 获取抽中id
*/ 
export function lott_chou(param){
	let params={
		pwd:pwd,
        ...param
	}
  return request.post('yx/lott_chou',params);
}
/**
 * 抽中后发送红包
*/ 
export function vo_pic_js_cj(param){
	let params={
		pwd:pwd,
        ...param
	}
  return request.post('yx/vo_pic_js_cj',params);
}
/**
 * 获取中奖名单
*/ 
export function lott_user_list(param){
	let params={
		pwd:pwd,
        ...param
	}
  return request.post('yx/lott_user_list',params);
}

/**
 * 下单支付
*/ 
export function wxpay(param){
	let params={
		pwd:pwd,
		token:token,
		...param
	}
  return request.post('pay/wxpay',params);
}

/**
 * 计算观看了多长时间
*/ 
export function editVideoTime(param){
	let params={
		pwd:pwd,
		token:token,
		...param
	}
  return request.post('yx/vode_user_duration_edit',params);
}

/**
 * 根据视频id查询点赞红包算法
*/ 
export function hdvideo_hb_suan(param){
	let params={
		pwd:pwd,
		...param
	}
  return request.post('yx/hdvideo_hb_suan',params,{noAuth:true});
}
/**
 * 点赞发红包
*/ 
export function vo_pic_dz(param){
	let params={
		pwd:pwd,
		...param
	}
  return request.post('yx/vo_pic_dz',params,{noAuth:true});
}

/**
 * 根据视频id查询评论
*/ 
export function getCommentList(id){
	let params={
		pwd:pwd,
		token:token,
		id:id
	}
  return request.post('yx/comment_void_list',params,{noAuth:true});
}

/**
 * 获取礼物图标
*/ 
export function getGiftList(id){
	let params={
		pwd:pwd,
		token:token,
		id:id
	}
  return request.post('yx/gift_list',params,{noAuth:true});
}

/**
 * 发送评论
*/ 
export function sendComment(param){
	let params={
		pwd:pwd,
		token:token,
		...param
	}
  return request.post('yx/comment_void_add',params,{noAuth:true});
}

/**
 * 分享图片
*/ 
export function posterFile(){
	let params={
		pwd:pwd,
		token:token
	}
  return request.post('yx/poster_json',params);
}

export function vo_integral_user(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/vo_integral_user',params);
}

export function product_integral_list_json(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/product_integral_list_json',params);
}

export function integral_product_id(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/integral_product_id',params);
}

export function integral_specification_id(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/integral_specification_id',params);
}
export function specification_id_one_inte(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/specification_id_one_inte',params);
}
export function integral_order_add_json(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/integral_order_add_json',params);
}

export function load_user_tow(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/load_user_tow',params);
}
export function user_integral_order_list(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/user_integral_order_list',params);
}
export function uintegral_order_inone(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/uintegral_order_inone',params);
}
export function address_one(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/address_one',params);
}

export function distributors_one(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/distributors_one',params);
}

export function my_load_text(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/my_load_text',params);
}

export function integral_suan(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/integral_suan',params);
}

export function integral_user_inc(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/integral_user_inc',params);
}

export function integral_user_list_json(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/integral_user_list_json',params);
}

export function inte_user_qian_sum(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/inte_user_qian_sum',params);
}

export function integral_user_inc_int(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/integral_user_inc_int',params);
}
//答题后直接领取红包
export function vo_pic_js_dati(param){
	let params={
		pwd:pwd,
		token:token,
        ...param
	}
  return request.post('yx/vo_pic_js_dati',params);
}

